package xyz.zq.cloud.common.security.exception;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Getter;
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;
import xyz.zq.cloud.common.security.component.CloudAuth2ExceptionSerializer;

/**
 * 自定义OAuth2Exception
 *
 * @author hzq
 * @date 2020/4/28 21:09
 */
@JsonSerialize(using = CloudAuth2ExceptionSerializer.class)
public class CloudAuth2Exception extends OAuth2Exception {
    @Getter
    private String errorCode;

    public CloudAuth2Exception(String msg) {
        super(msg);
    }

    public CloudAuth2Exception(String msg, String errorCode) {
        super(msg);
        this.errorCode = errorCode;
    }
}
